
#include "refcount.h"

namespace dhd
{
#ifdef NO_USE_GCC_BUILTINS
    #include <glib.h>

    void intrusive_ptr_add_ref( Refcounted * r )
    {
        g_atomic_int_inc( &r->refcount );
    }

    void intrusive_ptr_release( Refcounted * b )
    {
        if( g_atomic_int_dec_and_test( &r->refcount ) )
            r->on_zero_refcount();
    }
#endif
}


